﻿@model WorkTimePrj.Models.VAC_OT_New
@{
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
    <title>请假外出申请</title>
    <link href="@Url.Content("~/Content/themes/base/jquery.ui.all.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
    <link type="text/css" rel="stylesheet" media="screen" href="@Url.Content("~/Content/css/Screen.css")" />
    <link type="text/css" rel="stylesheet" media="handheld" href="@Url.Content("~/Content/css/Mobile.css")" />
    <script src="@Url.Content("~/Scripts/jquery-1.7.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/DatePicker/WdatePicker.js")" type="text/javascript"></script>
    <style type="text/css">
        
    </style>
    <script type="text/javascript">
        $(function () {
            $('#account').change(function () {
                //debugger
                //alert('Hi');
                var acc = $(this).val();
                $.ajax({
                    type: "POST",
                    url: '@Url.Action("GetUserVACAmount", "Admin") ',
                    data: { account: acc },
                    cache: false,
                    success: function (ret) {
                        debugger
                        var val = eval(ret)
                        $('.Col4').show();
                        $('#SPDisplayName').text(val.DisplayName);
                        $('#SPTotalALAmount').text(val.TotalALAmount);
                        $('#SPUsedALAmount').text(val.UsedALAmount);
                        $('#SPRemainingALAmount').text(val.RemainingALAmount);
                        $('#SPTotalSickLeaveAmount').text(val.TotalSickLeaveAmount);
                        $('#SPUsedSickLeaveAmount').text(val.UsedSickLeaveAmount);
                        $('#SPRemainingSickLeaveAmount').text(val.RemainingSickLeaveAmount);
                        $('#role').val(val.msg);
                    }
                });
            });
        });
    </script>
</head>
<body>
    @using (Html.BeginForm("AddVacOT_New", "Admin"))
    {
        @Html.ValidationSummary(true)
        <div class="WP_3">@ViewBag.adduser</div>
        <div class="WP_1">
            请假外出申请
        </div>
        <div class="WP_2">
            <table style="" cellpadding="0" cellspacing="0">
                <tr>
                    <td class="Col1">
                        <div class="editor-label">
                            <label>
                                申请人</label>
                        </div>
                    </td>
                    <td class="Col2">
                        <div class="editor-field">
                            @Html.DropDownListFor(model => model.account, (SelectList)ViewBag.accSelectList)
                            @Html.ValidationMessageFor(model => model.account)
                        </div>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" style="text-align: left;">
                        <span id="SPDisplayName" style="color: Red;">@ViewBag.adduser</span>&nbsp; 年假总数<span
                            id="SPTotalALAmount">@ViewBag.TotalALAmount</span>小时&nbsp;已用年假<span id="SPUsedALAmount">@ViewBag.UsedALAmount</span>小时&nbsp;剩余年假<span
                                id="SPRemainingALAmount">@ViewBag.RemainingALAmount</span>小时
                        <br />
                        病假总数<span id="SPTotalSickLeaveAmount">@ViewBag.TotalSickLeaveAmount</span>小时&nbsp;已用病假<span
                            id="SPUsedSickLeaveAmount">@ViewBag.UsedSickLeaveAmount</span>小时&nbsp;剩余年假<span id="SPRemainingSickLeaveAmount">@ViewBag.RemainingSickLeaveAmount</span>小时
                    </td>
                </tr>
                <tr>
                    <td class="Col1">
                        <div class="editor-label">
                            <label>
                                类型</label>
                        </div>
                    </td>
                    <td class="Col2">
                        <div class="editor-field">
                            @Html.DropDownListFor(model => model.type, (SelectList)ViewBag.typeSelectList)
                            @Html.ValidationMessageFor(model => model.type)
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="Col1">
                        <div class="editor-label">
                            <label>
                                开始日期</label>
                        </div>
                    </td>
                    <td class="Col2">
                        <div class="editor-field">
                            @Html.TextBoxFor(model => model.startDate, new { @Value = ViewBag.startTime, onclick = "WdatePicker({dateFmt:'yyyy-MM-dd'})", @class = "TB01" })
                            @Html.ValidationMessageFor(model => model.startDate)
                            @Html.DropDownListFor(model => model.startTime, (SelectList)ViewBag.hourSelectList)
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="Col1">
                        <div class="editor-label">
                            @Html.LabelFor(model => model.hour)
                        </div>
                    </td>
                    <td class="Col2">
                        <div class="editor-field">
                            @Html.TextBoxFor(model => model.hour, new { @class = "TB01" }) 小时
                            @Html.ValidationMessageFor(model => model.hour)
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="Col3">
                        <div class="editor-label">
                            <span class="SP01">@Html.LabelFor(model => model.Cause)</span>
                        </div>
                    </td>
                    <td class="Col2" style="text-align: left;">
                        <div class="editor-field">
                            @Html.TextAreaFor(model => model.Cause, new { @style = "width:90%;overflow:hidden;", rows = "5", cols = "90" })
                            @Html.ValidationMessageFor(model => model.Cause)
                        </div>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <input id="BtnSubmit" type="submit" value="保存" class="Button01" />
                    </td>
                </tr>
            </table>
        </div>
    }
    @Html.CommonnScript()
</body>
</html>
